import {post, get, put, Delete, postObj} from '@/axios/http.js'


// 省市区三级查询  查询省
export const getProvince = () => {
    return get('/educloud/common/province')
}
// 省市区三级查询  查询市
export const getCity = (param) => {
    return get('/educloud/common/city', param)
}
// 省市区三级查询  查询县
export const getDist = (param) => {
    return get('/educloud/common/district', param)
}

// 首页tab切换栏
export const getProjectTypes = () => {
    return get('/educloud/project/getProjectTypes')
}

// 首页列表
export const getmenu = params => {
    return get('/educloud/commodity/getmenu', params)
}

// 加入购物车
export const addCart = params => {
    return post('/educloud/car/save', params)
}

// 详情获取评论
export const getCommentList = params => {
    return post('/educloud/comment/pageCommentList', params)
}

// 购物车查询列表
export const getAlllist = () => {
    return get('/educloud/car/alllist')
}

// 购物车修改数量
export const updateCartNum = params => {
    return post('/educloud/car/update', params)
}

// 除购物车
export const deleteCart = params => {
    return get('/educloud/car/delete', params)
}

// 购物车加入收藏夹
export const addCollection = params => {
    return postObj('/educloud/collection/addCollection', params)
}

// 拿到订单订单号
export const getOrderNumber = params => {
    return post('/educloud/order/save?carId=' + params)
}

// 确认订单列表
export const getOrderAlllist = params => {
    return get('/educloud/order/myAllOrder', params)
}

// 获取详情
export const getShopDetail = params => {
    return get('/educloud/commodity/selectCommodityById', params)
}

// 详情页点击立即购买
export const getBuyNowOrderNumber = params => {
    return get('/educloud/order/paySave', params)
}

// 获取微信支付二维码
export const getWXQRCode = params => {
    return post('educloud/api/wx/getWxCode?orderNo=' + params)
}

//  获取支付是否成功
export const getIsSuccess = params => {
    return get('/educloud/api/wx/getPayStatusByOrderNo',params)
}

// 用户中心--首页--查询消费趋势
export const getStatisticsData = () => {
    return get('/educloud/statistics/findconsumptionTrends')
}

// 用户中心--我的收藏列表
export const getCollectList = params => {
    return get('/educloud/collection/pageCollectionList', params)
}

// 用户中心--我的收藏--删除
export const deleteCollectByIds = params => {
    return post('/educloud/collection/removeCollection', params)
}

// 用户中心--我的发票--查询发票记录
export const getInvoiceList = params => {
    return get('/educloud/invoice/getApplyInvoice', params)
}

// 用户中心--我的发票--发票信息管理--新增
export const addInvoiceInfo = params => {
    return post('/educloud/invoice/addInvoiceInfo', params)
}

// 用户中心--我的发票--发票信息管理--修改
export const updateInvoiceInfo = params => {
    return post('/educloud/invoice/updateInvoiceInfo',params)
}

// 用户中心--我的发票--发票信息管理--列表数据
export const getInvoiceInfoList = (param) => {
    return post('/educloud/invoice/getInvoiceInfo', param)
}
// 用户中心--我的发票--设为默认抬头
export const updateInfoStatus = (param) => {
    return post('/educloud/invoice/updateInfoStatus', param)
}
// 用户中心--我的发票--删除抬头
export const deleteInvoinceInfo = (param) => {
    return get('/educloud/invoice/deleteInvoice', param)
}

// 用户中心--我的发票--删除发票
export const deleteInvoince = params => {
    return get('/educloud/invoice/deleteInvoiceById',params)
}

// 用户中心--我的发票--重新申请
export const reapplyInvoince = parpams => {
    return get('/educloud/invoice/reApply',parpams)
}

// 用户中心--我的发票--寄送地址--新增
export const saveAddrInfo = (param) => {
    return post('/educloud/invoice/addInvoiceAddress', param)
}

// 用户中心--我的发票--寄送地址--列表数据
export const addrInfoList = (param) => {
    return post('/educloud/invoice/findInvoiceAddress', param)
}

// 用户中心--我的发票--寄送地址--设为默认
export const updateAddressStatus = (param) => {
    return post('/educloud/invoice/updateAddressStatus', param)
}
// 用户中心--我的发票--寄送地址--删除地址
export const deleteAddress = (param) => {
    return get('/educloud/invoice/delInvoiceAddress', param)
}

// 用户中心--我的发票--索取发票--订单列表数据
export const searchInvoiceOrderList = (params) => {
    return post('/educloud/order/alllist',params)
}

// 用户中心--我的发票--索取发票--订单列表数据(带参数)
export const searchInvoiceOrderListByParam = (param) => {
    return post('/educloud/order/alllist', param)
}
// 用户中心--我的发票--索取发票--新增发票
export const addInvoiceInvoice = (param) => {
    return post('/educloud/invoice/addInvoice', param)
}

// 用户中心--我的订单
export const getUserOrderList = (params, page, pageSize) => {
    return postObj(`/educloud/order/orderList?page=${page}&pageSize=${pageSize}`, params)
}

// 用户中心--我的订单——评论
export const addOrderComment = params => {
    return post('/educloud/comment/addComment', params)
}

// 用户中心--我的订单--系统下拉框
export const getSystemSelect = params => {
    return get('/educloud/commodity/commodityList', params)
}

// 用户中心--我的订单--删除订单
export const cancelOrDeleteOrder = params => {
    return postObj('/educloud/order/delOrder', params)
}

// 用户中心--我的订单--取消订单
export const cancelOrder = params => {
    return postObj('/educloud/order/removeOrderStatus', params)
}
